<p>这是一个代办列表</p>
<hr />
<div>
  <input type="text" [(ngModel)]="todo" placeholder="请输入代办事项" />
  <button (click)="doAdd()">添加事项</button>
</div>
<div *ngIf=" size > 0 else elseBlock">
  <ul *ngFor="let item of todoList; index as i;">
    <span>{{i+1}}.</span>
    <span>{{item}}</span>
    <button (click)="doDelete(i)">删除</button>
  </ul>
</div>
<ng-template #elseBlock><p [ngStyle]="{'color':'red'}">尚无代办事项</p></ng-template>
